package com.example.teesystem.common.exception;

import com.example.teesystem.common.utils.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 自定义异常
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class CustomException extends RuntimeException{
    private static final long serialVersionUID = 1L;
    
    private String msg;
    private Integer code;
    
    public CustomException(ResultCode resultCode) {
        this.msg = resultCode.getMsg();
        this.code = resultCode.getCode();
    }
}
